home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 December / maximum-cd-2009-12.iso / DiscContents / gimp-2.7.0-i686-setup.exe / {app} / share / gimp / 2.0 / scripts / gradient-bevel-logo.scm < prev    next >
Encoding:
GIMP Script-Fu Script  |  2009-08-19  |  5.6 KB  |  148 lines

  1. ; GIMP - The GNU Image Manipulation Program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ;
  4. ; This program is free software: you can redistribute it and/or modify
  5. ; it under the terms of the GNU General Public License as published by
  6. ; the Free Software Foundation; either version 3 of the License, or
  7. ; (at your option) any later version.
  8. ;
  9. ; This program is distributed in the hope that it will be useful,
  10. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ; GNU General Public License for more details.
  13. ;
  14. ; You should have received a copy of the GNU General Public License
  15. ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16. ;
  17. ;  Gradient Bevel v0.1  04/08/98
  18. ;  by Brian McFee <keebler@wco.com>
  19. ;  Create cool glossy bevelly text
  20.  
  21. (define (apply-gradient-bevel-logo-effect img
  22.                                           logo-layer
  23.                                           b-size
  24.                                           bevel-height
  25.                                           bevel-width
  26.                                           bg-color)
  27.   (let* (
  28.         (width (car (gimp-drawable-width logo-layer)))
  29.         (height (car (gimp-drawable-height logo-layer)))
  30.         (indentX (+ b-size 12))
  31.         (indentY (+ b-size (/ height 8)))
  32.         (bg-layer (car (gimp-layer-new img width height RGBA-IMAGE "Background" 100 NORMAL-MODE)))
  33.         (blur-layer (car (gimp-layer-new img width height RGBA-IMAGE "Blur" 100 NORMAL-MODE)))
  34.         )
  35.  
  36.     (gimp-context-push)
  37.  
  38.     (script-fu-util-image-resize-from-layer img logo-layer)
  39.     (script-fu-util-image-add-layers img blur-layer bg-layer)
  40.  
  41.     (gimp-selection-all img)
  42.     (gimp-context-set-background bg-color)
  43.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  44.     (gimp-selection-none img)
  45.  
  46.     (gimp-layer-set-lock-alpha blur-layer TRUE)
  47.     (gimp-context-set-background '(255 255 255))
  48.     (gimp-selection-all img)
  49.     (gimp-edit-fill blur-layer BACKGROUND-FILL)
  50.     (gimp-edit-clear blur-layer)
  51.     (gimp-selection-none img)
  52.     (gimp-layer-set-lock-alpha blur-layer FALSE)
  53.     (gimp-selection-layer-alpha logo-layer)
  54.     (gimp-edit-fill blur-layer BACKGROUND-FILL)
  55.     (plug-in-gauss-rle RUN-NONINTERACTIVE img blur-layer bevel-width 1 1)
  56.     (gimp-selection-none img)
  57.     (gimp-context-set-background '(127 127 127))
  58.     (gimp-context-set-foreground '(255 255 255))
  59.     (gimp-layer-set-lock-alpha logo-layer TRUE)
  60.     (gimp-selection-all img)
  61.  
  62.     (gimp-edit-blend logo-layer FG-BG-RGB-MODE NORMAL-MODE
  63.                      GRADIENT-RADIAL 95 0 REPEAT-NONE FALSE
  64.                      FALSE 0 0 TRUE
  65.                      indentX indentY indentX (- height indentY))
  66.  
  67.     (gimp-selection-none img)
  68.     (gimp-layer-set-lock-alpha logo-layer FALSE)
  69.     (plug-in-bump-map RUN-NONINTERACTIVE img logo-layer blur-layer 115 bevel-height 5 0 0 0 15 TRUE FALSE 0)
  70.     (gimp-layer-set-offsets blur-layer 5 5)
  71.     (gimp-invert blur-layer)
  72.     (gimp-layer-set-opacity blur-layer 50.0)
  73.     (gimp-image-set-active-layer img logo-layer)
  74.  
  75.     (gimp-context-pop)
  76.   )
  77. )
  78.  
  79. (define (script-fu-gradient-bevel-logo-alpha img
  80.                                              logo-layer
  81.                                              b-size
  82.                                              bevel-height
  83.                                              bevel-width
  84.                                              bg-color)
  85.   (gimp-image-undo-group-start img)
  86.   (apply-gradient-bevel-logo-effect img logo-layer b-size
  87.                                     bevel-height bevel-width bg-color)
  88.   (gimp-image-undo-group-end img)
  89.   (gimp-displays-flush)
  90. )
  91.  
  92. (script-fu-register "script-fu-gradient-bevel-logo-alpha"
  93.   _"Gradient Beve_l..."
  94.   _"Add a shiny look and bevel effect to the selected region (or alpha)"
  95.   "Brian McFee <keebler@wco.com>"
  96.   "Brian McFee"
  97.   "April 1998"
  98.   "RGBA"
  99.   SF-IMAGE      "Image"                     0
  100.   SF-DRAWABLE   "Drawable"                  0
  101.   SF-ADJUSTMENT _"Border size (pixels)"     '(22 1 300 1 10 0 1)
  102.   SF-ADJUSTMENT _"Bevel height (sharpness)" '(40 1 250 1 10 0 1)
  103.   SF-ADJUSTMENT _"Bevel width"              '(2.5 1 200 1 10 1 1)
  104.   SF-COLOR      _"Background color"         "white"
  105. )
  106.  
  107. (script-fu-menu-register "script-fu-gradient-bevel-logo-alpha"
  108.                          "<Image>/Filters/Alpha to Logo")
  109.  
  110.  
  111. (define (script-fu-gradient-bevel-logo text
  112.                                        size
  113.                                        font
  114.                                        bevel-height
  115.                                        bevel-width
  116.                                        bg-color)
  117.   (let* (
  118.         (img (car (gimp-image-new 256 256 RGB)))
  119.         (border (/ size 4))
  120.         (text-layer (car (gimp-text-fontname img -1 0 0 text
  121.                                              border TRUE size PIXELS font)))
  122.         )
  123.     (gimp-image-undo-disable img)
  124.     (apply-gradient-bevel-logo-effect img text-layer border
  125.                                       bevel-height bevel-width bg-color)
  126.     (gimp-image-undo-enable img)
  127.     (gimp-display-new img)
  128.   )
  129. )
  130.  
  131. (script-fu-register "script-fu-gradient-bevel-logo"
  132.   _"Gradient Beve_l..."
  133.   _"Create a logo with a shiny look and beveled edges"
  134.   "Brian McFee <keebler@wco.com>"
  135.   "Brian McFee"
  136.   "April 1998"
  137.   ""
  138.   SF-STRING     _"Text"                     "Moo"
  139.   SF-ADJUSTMENT _"Font size (pixels)"       '(90 2 1000 1 10 0 1)
  140.   SF-FONT       _"Font"                     "Sans Bold"
  141.   SF-ADJUSTMENT _"Bevel height (sharpness)" '(40 1 250 1 10 0 1)
  142.   SF-ADJUSTMENT _"Bevel width"              '(2.5 1 200 1 10 1 1)
  143.   SF-COLOR      _"Background color"         "white"
  144. )
  145.  
  146. (script-fu-menu-register "script-fu-gradient-bevel-logo"
  147.                          "<Image>/File/Create/Logos")
  148.